/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.server.database.engine.ddl.field.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snail.server.database.engine.ddl.field.entity.Field;
import com.snail.server.database.engine.ddl.field.mapper.FieldMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author zgadmin
 * @date 2025/8/29 14:44
 *
 */
@Service
public class FieldService extends ServiceImpl<FieldMapper, Field> {

    public boolean dropTable(Long tableId) {
        return remove(Wrappers.lambdaQuery(Field.class).eq(Field::getTableId, tableId));
    }

    public List<Field> queryByTable(Long tableId) {
        return list(Wrappers.lambdaQuery(Field.class).eq(Field::getTableId, tableId));
    }
}